package job;

import dao.IOrderDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @aythor:侯仪澳
 * @data:2022/8/10
 */
//定时任务类
@Component
public class MyJob {
    @Autowired
    private IOrderDao orderDao;

    //定时任务-扫面待付款订单，下单时间超过15分钟未付款，则交易失败
    @Scheduled(cron = "0 */1 * * * ?")
    public void scan(){
        orderDao.jobForOrder();
    }
}
